import tkinter

from tkinter import *

root = tkinter.Tk()
root.geometry('800x600')
cv = tkinter.Canvas(root,bg='skyblue')

line1 = cv.create_line(0,0,100,50)
rect1 = cv.create_rectangle(50,50,100,100,tags = 'rect1')


def press(event):
    print('wwwwww')
cv.tag_bind('rect1','<Button-1>',press)



cv.pack()

root.mainloop()